<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<!-- #include virtual=/inc/action.header.inc.asp -->

<%
	'## 파라미터 변수 선언부
	processNm	= Request("findProcess")

	
	SQLTitle = "-- ■■■■ 공정그룹 관리 그리드 List up ■■■■"
	
	'## 검색조건에 따른 조건절 만들기 
	If processNm <> "" Then 
		addSql = " processNm LIKE '%" & processNm & "%' "
	End If 
	If addSql <> "" Then 
		addSql = " WHERE " & addSql 
	End If 

	SQL = "SELECT procTypeCd, procTypeNm, processCds, CONVERT(varchar(16), issueDt, 121) issueDt, flag FROM tblProcSet " & addSql & " ORDER BY flag DESC, procTypeNm" 

	If xMode="debug" Then 
		Call showDebug(SQLTitle,SQL) 
	End If 

	Set Rs=Server.CreateObject("ADODB.RecordSet")
	Rs.open SQL, DbCon, 1
	
	Response.write "<ProcSet>" & vbcrlf

	If Rs.eof Or Rs.bof Then 
	Else 
		Do Until Rs.eof Or Rs.bof
		
			divProc = Split(rs("processCds"),",")
			procSet = ""
			For i=0 To UBound(divProc)
				If divProc(i) <> "" Then 
					If procSet <> "" Then 
						procSet = procSet & " -> "
					End If 
					procNm = aFieldValue("SELECT processNm FROM tblUnitProcess WHERE processCd='" & divProc(i) & "'")
					procSet = procSet & procNm
				End If 
			Next 
			If Len(procSet) >25 Then 
				procSet = Left(procSet,25) & "..."
			End If 
			Response.write "	<ProcList>" & vbcrlf
				Call mkXMLNode("procTypeCd", rs("procTypeCd"), 2)
				Call mkXMLNode("procTypeNm", rs("procTypeNm"), 2)
				Call mkXMLNode("procSet", procSet, 2)
				Call mkXMLNode("issueDt", rs("issueDt"), 2)
				Call mkXMLNode("flag", Rs("flag"), 2)
			Response.write "	</ProcList>" & vbcrlf

		Rs.movenext
		Loop 
	End If
	Response.write "</ProcSet>" & vbcrlf
'	Call rsWithXML("Save OK!")
%>